/*
这个主要用于测试日志系统和进度条打印
*/

#include "DumpLog.h"
#include "ParseParam.h"
#include "SolveEqu.h"
#include <thread>

using namespace Parse;
int main(int n, char **args)
{
    //1.测试参数解析定义
    uint32_t type(0);
    std::string strParam("");
    const vecParseParam_t params
    {
        ParseParam_t("type", "t", true , ParamType_E::UInt32_E, &type,    "执行类型,当此参数为1时,将测试日志进度条打印"),
        ParseParam_t("str" , "s", false, ParamType_E::String_E, &strParam, "一个字符串测试参数"),
    };

    //2.测试参数解析
    if (n == 1 || !parseParam(args, n, params))
    {
        //测试命令行帮助提示
        printCmd(params, "主要用于日志与进度条测试");
        return 0;
    }

    //3. 测试日志打印
    LogInfo("type = {}", type);
    LogInfo("strParm = {}", strParam);

    //4. 测试进度条
    if (type == 1)
    {
        BarInit(168, "进度");
        for (int i = 0; i != 168; ++i)
        {
            BarAddOne();
            std::this_thread::sleep_for(std::chrono::milliseconds(128));
        }
        BarStop();
    }

    return 0;
}